package com.subang.function.service.impl;

import java.util.List;
import com.subang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.subang.function.mapper.SbAnswerRecordMapper;
import com.subang.function.domain.SbAnswerRecord;
import com.subang.function.service.ISbAnswerRecordService;

/**
 * 答题记录Service业务层处理
 * 
 * @author subei
 * @date 2025-04-22
 */
@Service
public class SbAnswerRecordServiceImpl implements ISbAnswerRecordService 
{
    @Autowired
    private SbAnswerRecordMapper sbAnswerRecordMapper;

    /**
     * 查询答题记录
     * 
     * @param id 答题记录主键
     * @return 答题记录
     */
    @Override
    public SbAnswerRecord selectSbAnswerRecordById(Long id)
    {
        return sbAnswerRecordMapper.selectSbAnswerRecordById(id);
    }

    /**
     * 查询答题记录列表
     * 
     * @param sbAnswerRecord 答题记录
     * @return 答题记录
     */
    @Override
    public List<SbAnswerRecord> selectSbAnswerRecordList(SbAnswerRecord sbAnswerRecord)
    {
        return sbAnswerRecordMapper.selectSbAnswerRecordList(sbAnswerRecord);
    }

    /**
     * 新增答题记录
     * 
     * @param sbAnswerRecord 答题记录
     * @return 结果
     */
    @Override
    public int insertSbAnswerRecord(SbAnswerRecord sbAnswerRecord)
    {
        sbAnswerRecord.setCreateTime(DateUtils.getNowDate());
        return sbAnswerRecordMapper.insertSbAnswerRecord(sbAnswerRecord);
    }

    /**
     * 修改答题记录
     * 
     * @param sbAnswerRecord 答题记录
     * @return 结果
     */
    @Override
    public int updateSbAnswerRecord(SbAnswerRecord sbAnswerRecord)
    {
        return sbAnswerRecordMapper.updateSbAnswerRecord(sbAnswerRecord);
    }

    /**
     * 批量删除答题记录
     * 
     * @param ids 需要删除的答题记录主键
     * @return 结果
     */
    @Override
    public int deleteSbAnswerRecordByIds(Long[] ids)
    {
        return sbAnswerRecordMapper.deleteSbAnswerRecordByIds(ids);
    }

    /**
     * 删除答题记录信息
     * 
     * @param id 答题记录主键
     * @return 结果
     */
    @Override
    public int deleteSbAnswerRecordById(Long id)
    {
        return sbAnswerRecordMapper.deleteSbAnswerRecordById(id);
    }
}
